package com.ruoyi.part.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.part.mapper.DmsPartsPurchaseOrderDetailMapper;
import com.ruoyi.part.domain.DmsPartsPurchaseOrderDetail;
import com.ruoyi.part.service.IDmsPartsPurchaseOrderDetailService;

/**
 * 零件采购详细Service业务层处理
 * 
 * @author liuchuanfa
 * @date 2024-03-17
 */
@Service
public class DmsPartsPurchaseOrderDetailServiceImpl extends ServiceImpl<DmsPartsPurchaseOrderDetailMapper,DmsPartsPurchaseOrderDetail> implements IDmsPartsPurchaseOrderDetailService
{
    @Autowired
    private DmsPartsPurchaseOrderDetailMapper dmsPartsPurchaseOrderDetailMapper;

    /**
     * 查询零件采购详细
     * 
     * @param id 零件采购详细主键
     * @return 零件采购详细
     */
    @Override
    public DmsPartsPurchaseOrderDetail selectDmsPartsPurchaseOrderDetailById(Long id)
    {
        return dmsPartsPurchaseOrderDetailMapper.selectDmsPartsPurchaseOrderDetailById(id);
    }

    /**
     * 查询零件采购详细列表
     * 
     * @param dmsPartsPurchaseOrderDetail 零件采购详细
     * @return 零件采购详细
     */
    @Override
    public List<DmsPartsPurchaseOrderDetail> selectDmsPartsPurchaseOrderDetailList(DmsPartsPurchaseOrderDetail dmsPartsPurchaseOrderDetail)
    {
        return dmsPartsPurchaseOrderDetailMapper.selectDmsPartsPurchaseOrderDetailList(dmsPartsPurchaseOrderDetail);
    }

    /**
     * 新增零件采购详细
     * 
     * @param dmsPartsPurchaseOrderDetail 零件采购详细
     * @return 结果
     */
    @Override
    public int insertDmsPartsPurchaseOrderDetail(DmsPartsPurchaseOrderDetail dmsPartsPurchaseOrderDetail)
    {
        dmsPartsPurchaseOrderDetail.setCreateTime(DateUtils.getNowDate());
        return dmsPartsPurchaseOrderDetailMapper.insertDmsPartsPurchaseOrderDetail(dmsPartsPurchaseOrderDetail);
    }

    /**
     * 修改零件采购详细
     * 
     * @param dmsPartsPurchaseOrderDetail 零件采购详细
     * @return 结果
     */
    @Override
    public int updateDmsPartsPurchaseOrderDetail(DmsPartsPurchaseOrderDetail dmsPartsPurchaseOrderDetail)
    {
        dmsPartsPurchaseOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return dmsPartsPurchaseOrderDetailMapper.updateDmsPartsPurchaseOrderDetail(dmsPartsPurchaseOrderDetail);
    }

    /**
     * 批量删除零件采购详细
     * 
     * @param ids 需要删除的零件采购详细主键
     * @return 结果
     */
    @Override
    public int deleteDmsPartsPurchaseOrderDetailByIds(Long[] ids)
    {
        return dmsPartsPurchaseOrderDetailMapper.deleteDmsPartsPurchaseOrderDetailByIds(ids);
    }

    /**
     * 删除零件采购详细信息
     * 
     * @param id 零件采购详细主键
     * @return 结果
     */
    @Override
    public int deleteDmsPartsPurchaseOrderDetailById(Long id)
    {
        return dmsPartsPurchaseOrderDetailMapper.deleteDmsPartsPurchaseOrderDetailById(id);
    }
}
